Skip to content

fix: hide invalidInfoBar when transitioning to IDLE state#577

Merged
andrewtavis merged 3 commits intoscribe-org:mainfrom
Mounil2005:fix/visible-info-texts
Mar 23, 2026
Merged

fix: hide invalidInfoBar when transitioning to IDLE state#577
andrewtavis merged 3 commits intoscribe-org:mainfrom
Mounil2005:fix/visible-info-texts

Conversation

@Mounil2005
Copy link
Contributor

@Mounil2005 Mounil2005 commented Mar 22, 2026

Contributor checklist

[] This pull request is on a separate branch and not the main branch
[] I have tested my code with the ./gradlew lintKotlin detekt test command as directed in the testing section of the contributing guide


Description

Fixes a keyboard state management regression where the "Not in Wikidata" / "Not in Wiktionary" info panel persists above the keyboard after the user closes it via the X button.

Root cause:

setupIdleView() in KeyboardUIManager.kt restored keyboardView visibility when returning to IDLE state but never hid invalidInfoBar
, leaving it overlaid on the keyboard permanently and making the X button unresponsive on subsequent presses.

Files changed:

  • app/src/main/java/be/scri/helpers/ui/KeyboardUIManager.kt
    — Added binding.invalidInfoBar.visibility = View.GONE and currentPage = 0 in setupIdleView() to ensure the info panel is fully cleared on every transition to IDLE state.

  • app/src/test/kotlin/be/scri/helpers/ui/KeyboardUIManagerTest.kt
    — Added two regression tests simulating the exact reproduction steps from the issue (for both INVALID and ALREADY_PLURAL
    paths, as both show the ⓘ button)

Tested by:
code review + unit tests (Robolectric) added; CI will validate

Related issue:
Closes #575

Signed-off-by: Mounil Kanakhara <mounilkankhara@gmail.com>
@github-actions
Copy link

Thank you for the pull request! 💙

The Scribe-Android team will do our best to address your contribution as soon as we can. If you're not already a member of our public Matrix community, please consider joining! We'd suggest that you use the Element client as well as Element X for a mobile app, and definitely join the General and Android rooms once you're in. Also consider attending our bi-weekly Saturday dev syncs. It'd be great to meet you 😊

Note

Scribe uses Conventional Comments in reviews to make sure that communication is as clear as possible.

@github-actions
Copy link

github-actions bot commented Mar 22, 2026

Maintainer Checklist

The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

  • Tests for changes have been written and the unit test, linting and formatting workflows within the PR checks do not indicate new errors in the files changed

    • Tests may need to be reran as they're at times not deterministic
  • The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

Signed-off-by: Mounil Kanakhara <mounilkankhara@gmail.com>
@Mounil2005
Copy link
Contributor Author

Hey @andrewtavis and @angrezichatterbox, I have fixed the bug, pls take a look and let me know in case of any changes.
Thanks!

@andrewtavis andrewtavis self-requested a review March 23, 2026 15:38
Copy link
Member

@andrewtavis andrewtavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking this with @angrezichatterbox now :)

praise, @Mounil2005: Thanks for the great and quick work here, and also for the tests!

note: I sent along a minor commit to clean up the comments as we like those that are their own line to be complete sentences with punctuation - inline comments don't need punctuation or capitalization of the first letter.

Please let us know if you'd like to work on another issue!

@andrewtavis andrewtavis merged commit 590e33d into scribe-org:main Mar 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Info texts on Wikidata and Wiktionary and shown above keyboard on cancel

2 participants